<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="js/jquery.js"></script>
<script>
$(document).ready(function() {
  $("#noidea").click(function(){
	  $.post("genedetails.action",
			    {
			      geneName:"TK0003"
			    },
			    function(data,status){
			      $("#geneDetailDIV").html(data);
			    });
  });
});

</script>
<title>Lab Management System</title>
</head>
<body bgcolor="">
<h1 align="center">Master Genome Tracking System</h1>
<table width="100%" bgcolor="#29B8FF">
	<tr>
		<td>
			<table width="100%" bgcolor="">
				<tr>
					<td>
					<h2>Search Gene</h2> 
					</td>
					<td width ="60%">
					<h2>Sequence Upload</h2>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
	<td>
		<table width="100%" bgcolor="#FFFFFF">
			<tr bgcolor="">
				<td width="40%">
					<font color="#000099">
					<s:form action="genedetails">
 		 			<s:select label="Gene name*" name="geneName" headerKey="1" headerValue="--Please Select a Gene--" list="geneList" />
 		 			<s:submit value="Go!" id="search"></s:submit>
 		 			</s:form>
 		 			</font>
				</td>
				<td width="60">
					<font color="#000099">File location*:</font> <input type="text"/><input type="button" value="Upload"/><br>
					<input type="button" value="Submit"/>
				</td>
			</tr>
		</table>
	</td>
	</tr>
</table>

<%
String geneName = null;
geneName = request.getParameter("geneName");
if (geneName != null) { %>
<!-- Start of Gene Detail Info -->
<div id = "geneDetailDIV">
<table width = "100%" bgcolor="#29B8FF">
				<tr>
					<td>
					<h2>Basic Gene Details</h2>
					</td>
				</tr>
			</table>
<table width="100%"  borderColor="#E0E0E0" border="1" style="BORDER-COLLAPSE: collapse" >
	<tr>
		<td align="right" width="30%">
			<font color="#000099">Gene name:</font>
		</td>
		<td align="left" width="70%">
		<s:property value = "gene.geneName"/>
		</td>
	</tr>
	<tr>
		<td align="right" width="30%">
			<font color="#000099">Common name:</font>
		</td>
		<td align="left" width="70%">
		<s:property value = "gene.commonName"/>
		</td>
	</tr>
	<tr>
		<td align="right">
			<font color="#000099">Gene Length (bp):</font>
		</td>
		<td align="left">
		<s:property value = "gene.geneLength"/>
		</td>
	</tr>
	<tr>
		<td align="right">
			<font color="#000099">Strand:</font>
		</td>
		<td align="left">
		<s:property value = "gene.strand"/>
		</td>
	</tr>
	<tr>
		<td align="right">
			<font color="#000099">Start:</font>
		</td>
		<td align="left">
		<s:property value = "gene.txStart"/>
		</td>
	</tr>
	<tr>
		<td align="right">
			<font color="#000099">End:</font>
		</td>
		<td align="left">
		<s:property value = "gene.txEnd"/>
		</td>
	</tr>
	<tr>
		<td align="right">
			<font color="#000099">N Overlap:</font>
		</td>
		<td align="left">
		<s:property value = "gene.nterm"/>
		</td>
	</tr>
	<tr>
		<td align="right">
			<font color="#000099">C Overlap:</font>
		</td>
		<td align="left">
		<s:property value = "gene.cterm"/>
		</td>
	</tr>
	<tr>
		<td align="right" >
			<font color="#000099">Comment:</font>
		</td>
		<td align="left">
		    <s:form action="updateGeneComment">
		    	<s:hidden value="%{gene.geneName}" name="geneName" />
				<s:textarea name="comment" cols="30" rows="5">
				</s:textarea>
				<s:submit value="update"></s:submit>
		    </s:form>
		</td>
	</tr>
</table>
</div>
<div id="primerInfo">
<s:iterator value="primerSeqList">
<s:property value="primer"/>
<s:property value="sequence"/>
<s:property value="plate"/>
<s:property value="well"/>
</s:iterator>

</div>
<%;} %>



<!-- End of Gene Detail Info -->
</body>
</html>